package com.metadata_system.common.db.entity;

import java.util.Date;
import javax.persistence.*;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@Table(name = "md_metadata")
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class Metadata {
    @Id
    private Integer id;

    /**
     * 元模型-名称
     */
    private String name;

    /**
     * 元模型-名称
     */
    @Column(name = "short_name")
    private String shortName;

    /**
     * 元模型-默认视图ID
     */
    @Column(name = "default_view_id")
    private Integer defaultViewId;

    /**
     * 元模型-视图总数
     */
    @Column(name = "view_total")
    private Integer viewTotal;

    /**
     * 元模型-视图数组
     */
    @Column(name = "view_arr")
    private String viewArr;


    /**
     * 元模型-可用-关系列表
     */
    @Column(name = "enable_edge_arr")
    private String enableEdgeArr;

    /**
     * 节点-总数
     */
    @Column(name = "node_total")
    private Integer nodeTotal;

    /**
     * 关系-总数
     */
    @Column(name = "edge_total")
    private Integer edgeTotal;

    /**
     * 数据-总数
     */
    @Column(name = "data_total")
    private Integer dataTotal;

    /**
     * 创建人ID
     */
    @Column(name = "created_user_id")
    private Integer createdUserId;

    /**
     * 更新时间
     */
    @Column(name = "updated_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updatedTime;

    /**
     * 创建时间
     */
    @Column(name = "created_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createdTime;
}